package org.lds.hotkey.client.autoconfigure.component;

import lombok.extern.slf4j.Slf4j;
import org.lds.hotkey.client.holder.WorkerHolder;
import org.lds.hotkey.common.util.ScheduledUtil;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;

@Slf4j
@Order(3000)
public class GetAndWatchWorkerRunner implements ApplicationRunner {

    @Override
    public void run(ApplicationArguments args) throws Exception {
        ScheduledUtil.defaultClosableScheduled(() -> WorkerHolder.start());
    }
}
